/*
 * @Author: 瞿旺兴 18774621495@163.com
 * @Date: 2022-06-01 09:45:11
 * @LastEditors: 瞿旺兴 18774621495@163.com
 * @LastEditTime: 2022-06-07 10:25:51
 * @FilePath: \nien-vue3-admin\src\api\BusinessConfig\sellPriceManagement.ts
 * @Description: 销售价管理
 */
import request from '@/utils/request'
// 销售价page列表
export function sellingPriceList(params) {
  return request({
    url: '/system/sellingPrice/list',
    method: 'get',
    params,
  })
}
// 新增销售价
export function sellingPriceAdd(data) {
  return request({
    url: '/system/sellingPrice/add',
    method: 'post',
    data,
  })
}
// 修改销售价
export function sellingPriceEdit(data) {
  return request({
    url: '/system/sellingPrice/edit',
    method: 'put',
    data,
  })
}
// 删除销售价
export function sellingPriceRemove(ids) {
  return request({
    url: `/system/sellingPrice/remove/${ ids }`,
    method: 'delete',
  })
}

// 国家分区

// 国家分区-列表
export function countryPartitionList(params) {
  return request({
    url: '/system/countryPartition/list',
    method: 'get',
    params,
  })
}
// 国家分区-新增
export function addData(data) {
  return request({
    url: '/system/countryPartition/add',
    method: 'post',
    data,
  })
}
// 国家分区-修改
export function countryPartitionEdit(data) {
  return request({
    url: '/system/countryPartition/edit',
    method: 'put',
    data,
  })
}
// 国家分区-删除(多个)
export function countryPartitionRemove(ids) {
  return request({
    url: `/system/countryPartition/remove/${ ids }`,
    method: 'delete',
  })
}
// 国家分区-批量新增或修改
export function batchAddOrUpdate(data) {
  return request({
    url: '/system/countryPartition/batchAddOrUpdate',
    method: 'post',
    data,
  })
}
// 国家分区-批量新增或修改前校验国家是否存在
export function batchCheckCountry(data) {
  return request({
    url: '/system/countryPartition/batchCheckCountry',
    method: 'post',
    data,
  })
}

// 查询销售价国家分区邮编列表
export function sellingPricePostcodeList(params) {
  return request({
    url: '/system/sellingPricePostcode/list',
    method: 'get',
    params,
  })
}

export function sellingPricePostcodeDelete(ids) {
  return request({
    url: `/system/sellingPricePostcode/${ ids }`,
    method: 'delete',
  })
}
// 新增或修改销售价国家分区邮编
export function sellingPricePostcodeUpdate(data) {
  return request({
    url: '/system/sellingPricePostcode',
    method: 'post',
    data,
  })
}

// 重量分区-page列表
export function weightPartitionList(params) {
  return request({
    url: '/system/weightPartition/list',
    method: 'get',
    params,
  })
}
// 重量分区-新增
export function weightPartitionAdd(data) {
  return request({
    url: '/system/weightPartition/add',
    method: 'POST',
    data,
  })
}
// 重量分区-修改
export function weightPartitionEdit(data) {
  return request({
    url: '/system/weightPartition/edit',
    method: 'PUT',
    data,
  })
}
// 重量分区-删除
export function weightPartitionRemove(ids) {
  return request({
    url: `/system/weightPartition/remove/${ ids }`,
    method: 'delete',
  })
}
// 重量分区-批量新增或修改销售价重量分区
export function weightPartitionAddOrEdit(data) {
  return request({
    url: '/system/weightPartition/addOrEdit',
    method: 'post',
    data,
  })
}
// 重量分区-复制成本价重量分区
export function copyCostPriceWeight(sellingPriceId) {
  return request({
    url: `/system/weightPartition/copyCostPriceWeight/${ sellingPriceId }`,
    method: 'get',
  })
}
// 重量分区-复制销售价重量模板
export function copySellingPriceWeight(sellingPriceId) {
  return request({
    url: `/system/weightPartition/copySellingPriceWeight/${ sellingPriceId }`,
    method: 'get',
  })
}

// ------------------价格详情

// 销售价格分仓Page列表
export function selectSellingPriceSiteList(params) {
  return request({
    url: '/system/sellingPriceSite/selectSellingPriceSiteList',
    method: 'get',
    params,
  })
}
// 新增销售价格分仓
export function sellingPriceSiteAdd(data) {
  return request({
    url: '/system/sellingPriceSite/add',
    method: 'post',
    data,
  })
}
// 修改销售价格分仓
export function sellingPriceSiteEdit(data) {
  return request({
    url: '/system/sellingPriceSite/edit',
    method: 'put',
    data,
  })
}
// 修改销售价格分仓状态
export function sellingPriceSiteEditStatus(data) {
  return request({
    url: '/system/sellingPriceSite/editStatus',
    method: 'put',
    data,
  })
}
// 删除销售价格分仓
export function sellingPriceSiteRemove(ids) {
  return request({
    url: `/system/sellingPriceSite/remove/${ ids }`,
    method: 'delete',
  })
}
// 查询销售价格分仓ById
export function sellingPriceSiteId(id) {
  return request({
    url: `/system/sellingPriceSite/${ id }`,
    method: 'get',
  })
}

// 调试销售价格分仓-单价管理-销售单价列表
export function siteSellingPartititonPriceInfoList(siteId, params) {
  return request({
    url: `/system/pricePartition/siteSellingPartititonPriceInfo/${ siteId }`,
    method: 'get',
    params,
  })
}

// 销售价格分仓-单价管理-批量新增设置分区销售管理价
export function pricePartitionBatchAdd(data) {
  return request({
    url: `/system/pricePartition/batchAdd`,
    method: 'POST',
    data,
  })
}
// 销售价格分仓-单价管理-复制成本价
export function copyCostPrice(sellingPriceId, data) {
  return request({
    url: `/system/pricePartition/copyCostPrice/${ sellingPriceId }`,
    method: 'post',
    data
  })
}
// 销售价格分仓-单价管理-复制销售价
export function copySellingPrice(sellingPriceId, data) {
  return request({
    url: `/system/pricePartition/copySellingPrice/${ sellingPriceId }`,
    method: 'post',
    data
  })
}

// 销售价格分仓-单价管理-批量新增设置分区销售管理价
export function sellingPriceSaveOrEdit(data) {
  return request({
    url: '/system/pricePartition/sellingPriceSaveOrEdit',
    method: 'POST',
    data,
  })
}
